from flask_restful import Resource

from model.crud import QueryMultipleInstances
from model.tables import Like
from restful.atomic.info.like._Like import _Like
from restful.data import DataPid
from restful.response import ResponseSuccess
from restful.session import login_required, data


class PostLike(Resource):
    @data(DataPid())
    def get(self,data):
        likes = QueryMultipleInstances(Like,{'pid':data['pid']})
        return ResponseSuccess(data={
            'get_likes':_Like(likes),
        })